package com.example.project;

import org.junit.jupiter.api.*;
import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;


@DisplayName("控制方法的执行顺序")
@TestMethodOrder(OrderAnnotation.class)
class OrderedDemo {

    private static int order = 0;

    @Test
    @Order(2)
    void emptyValues() {
        // perform assertions against empty values
        Assertions.assertEquals(++order,2);
    }

    @Test
    @Order(1)
    void nullValues() {
        // perform assertions against null values
        Assertions.assertEquals(++order,1);
    }



    @Test
    @Order(3)
    void validValues() {
        // perform assertions against valid values
        Assertions.assertEquals(++order,3);
    }

}